package org.example.controller;

import jakarta.annotation.Resource;
import org.example.entity.RestBean;
import org.example.entity.vo.response.MyDetailVO;
import org.example.service.MyDetailService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/my-detail")
public class MyDetailController {
    @Resource
    MyDetailService service;

    @GetMapping("/counter")
    public RestBean<MyDetailVO> counter(@RequestParam("userID") Integer userID) {
        return RestBean.success(service.getMyDetailVOByUserID(userID));
    }

    @GetMapping("/icon")
    public RestBean<String> icon(@RequestParam("userID") Integer userID) {
        return RestBean.success(service.getIconPathByUserID(userID));
    }
}
